import axios from '@/utils/request'
/**
 * 获取员工的简单信息
 */
export const employeesSimple = () => {
  return axios({
    url: '/sys/user/simple'
  })
}
// 获取员工详细列表
export const employeesDetail = (params) => {
  return axios({
    url: '/sys/user',
    params
  })
}
// 删除员工
export const delemployees = (id) => {
  return axios({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 添加员工
export const addemployees = (data) => {
  return axios({
    url: '/sys/user',
    method: 'POST',
    data
  })
}
// 批量导入员工
export const batchemployees = (data) => {
  return axios({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 更改用户密码账号个人信息
export const setuserInfoById = (data) => {
  return axios({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
// 获取员工个人详细信息
export const getPersonalDetail = (id) => {
  return axios({
    url: `/employees/${id}/personalInfo`
  })
}
// 保存员工基本信息
export const editUserinfoById = (data) => {
  return axios({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}
// 修改员工个人详细信息
export const updatePersonal = (data) => {
  return axios({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取岗位信息
export const getJobDetail = (id) => {
  return axios({
    url: `/employees/${id}/jobs`
  })
}
// 更新岗位信息
export const updateJob = (data) => {
  return axios({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
